//
//  QDTProtocolVC.m
//  QoilPublic
//
//  Created by 杨凯 on 16/12/20.
//  Copyright © 2016年 杨凯. All rights reserved.
//

#import "QDTProtocolVC.h"
#import "QWriteDataVC.h"
@interface QDTProtocolVC ()<UIWebViewDelegate>


@property (weak, nonatomic) IBOutlet UIWebView *webView;

@end

@implementation QDTProtocolVC

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"申请协议";
    self.view.backgroundColor = [UIColor groupTableViewBackgroundColor];
    [QViewUtility setupNavigationBarBackForController:self backSelector:@selector(dtProtocolback)];
    _webView.delegate = self;
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://baidu.com"]];
    [_webView loadRequest:request];
    [self setupForDismissKeyboard];
}

- (void)dtProtocolback{

    [self.navigationController popViewControllerAnimated:YES];
}

- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
    
    return YES;
}

- (void)webViewDidStartLoad:(UIWebView *)webView {
    
    [QViewUtility showMBHudToView:self.view hideBg:NO];
}

- (void)webViewDidFinishLoad:(UIWebView *)webView {
    
    [QViewUtility hideMBHudToView:self.view];
}


- (IBAction)buttonAction:(id)sender {
    
    QWriteDataVC *vc = [[QWriteDataVC alloc] initWithNibName:@"QWriteDataVC" bundle:nil];
    [self.navigationController pushViewController:vc animated:YES];
    
}

@end
